<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="flotaeliminarplacasform.title"/></title>
    <meta name="heading" content="<fmt:message key='flotaeliminarplacasform.title'/>"/>
</head>

<spring:bind path="fileUpload.*">
    <c:if test="${not empty status.errorMessages}">
    <div class="error">    
        <c:forEach var="error" items="${status.errorMessages}">
            <img src="<c:url value="/images/iconWarning.gif"/>"
                alt="<fmt:message key="icon.warning"/>" class="icon" />
            <c:out value="${error}" escapeXml="false"/><br />
        </c:forEach>
    </div>
    </c:if>
</spring:bind>
	
<form:form method="post" action="eliminarplacasform.html" 
	enctype="multipart/form-data" onsubmit="return validacion(this)" 
	id="eliminarplacasform" name="eliminarplacasform" commandName="fileUpload" >

   	<ul>
	<li>
	<label class="desc"><fmt:message key="clienteempresaform.title"/></label>
	<div class="group" style="width: 400px">    	
   		<div>	
	    	<label for="deRazonSocial" class="required desc">
	        <fmt:message key="clienteempresaform.razonsocial"/> 
	        </label>        
	             ${fileUpload.bncliente.deClienteEmpresa}
	            
  		</div><br/>
   		<div>	
	    	<label for="deRuc" class="required desc">
	        <fmt:message key="clienteempresaform.ruc"/> 
	        </label>        
	             ${fileUpload.bncliente.coRuc}

	             
  		</div><br/>
   		<div>	
	       <label for="deAlias" class="required desc">
	       <fmt:message key="clienteempresaform.flota"/> 
	       </label>        
	       ${fileUpload.deFlotaArea}
	             
	       <input type="hidden" id="deFlotaAreaID" name="deFlotaAreaID" value="${fileUpload.deFlotaArea}"> 
	       <input type="hidden" id="deAliasID" name="deAliasID" value="${fileUpload.bncliente.deAlias}">
     	   <input type="hidden" id="idFlotaID" name="idFlotaID" value="${fileUpload.coFlota}">
     	   <input type="hidden" id="idID" name="idID" value="${fileUpload.bncliente.id}">
  		</div>
	</div>	
	</li>
	</ul>
	    
	<ul>
	    <li class="info">
	        <fmt:message key="upload.message"/>
	    </li> 
	    	    
	    <li>
			<label for=file class="required desc">
	        <fmt:message key="uploadForm.file"/> <span class="req">*</span>
	        </label> 
	        <form:errors path="file" cssClass="fieldError"/>
	        <input type="file" name="file" id="file" class="file large"/>
	    </li> 
	    	    
	    <li class="buttonBar bottom">    
	        <input type="submit" class="button" name="save" value="<fmt:message key="button.upload"/>"/>
	            

	        
	    <input type="button" name = "cancel" class="button" onclick="location.href='<c:url value="/flota/flotaform.html?id=${fileUpload.coFlota}&from=list"/>'"
			        value="<fmt:message key="button.cancel"/>"/>   		        
	                 
	    </li>
	</ul>
	
		   			<c:if test="${not empty listErrorPlacaBlanco}">
			            <div class="error">
			              	<fmt:message key="flotaform.error.cargaarchivo.placas.obligatorio"/>
			            </div>    
			            <div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.placa"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="placaError" items="${listErrorPlacaBlanco}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${placaError.id}     
										</td>
						            	<td>
								       		${placaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
		            <c:if test="${not empty listErrorPlacaLongitud}">
			            <div class="error">
			              	<fmt:message key="flotaform.error.cargaarchivo.placas.longitud"/>
			            </div>    
			            <div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.placa"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="placaError" items="${listErrorPlacaLongitud}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${placaError.id}     
										</td>
						            	<td>
								       		${placaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
		            <c:if test="${not empty listErrorPlacaInvalida}">
			            <div class="error">
			              	<fmt:message key="flotaform.error.cargaarchivo.placas.invalida"/>
			            </div>    
			            <div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.placa"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="placaError" items="${listErrorPlacaInvalida}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${placaError.id}     
										</td>
						            	<td>
								       		${placaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
    				<c:if test="${not empty listErrorPlacaUsada}">
			            <div class="error">
			              	<fmt:message key="flotaform.error.cargaarchivo.placas.usada"/>
			            </div>    
			            <div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.placa"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="placaError" items="${listErrorPlacaUsada}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${placaError.id}     
										</td>
						            	<td>
								       		${placaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
    				<c:if test="${not empty listErrorPlacaRepetida}">
			            <div class="error">
			              	<fmt:message key="flotaform.error.cargaarchivo.placas.repetida"/>
			            </div>    
			            <div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.placa"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="placaError" items="${listErrorPlacaRepetida}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${placaError.id}     
										</td>
						            	<td>
								       		${placaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
    				
		            <c:if test="${not empty listErrorTarjetaBlanca}">
		            	<div class="error">
		            		<fmt:message key="flotaform.error.cargaarchivo.tarjetas.obligatorio"/>
		            	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.tarjeta"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="tarjetaError" items="${listErrorTarjetaBlanca}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"  ></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${tarjetaError.id}     
										</td>
						            	<td>
								       		${tarjetaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>        				
    				
    				<c:if test="${not empty listErrorTarjetaLongitud}">
		            	<div class="error">
		            		<fmt:message key="flotaform.error.cargaarchivo.tarjetas.longitud"/>
		            	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.tarjeta"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="tarjetaError" items="${listErrorTarjetaLongitud}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"  ></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${tarjetaError.id}     
										</td>
						            	<td>
								       		${tarjetaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>     				

		            <c:if test="${not empty listErrorTarjetaNoExiste}">
		            	<div class="error">
		            		<fmt:message key="flotaform.error.cargaarchivo.tarjetas.noexiste"/>
		            	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.tarjeta"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="tarjetaError" items="${listErrorTarjetaNoExiste}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"  ></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${tarjetaError.id}     
										</td>
						            	<td>
								       		${tarjetaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
    				<c:if test="${not empty listErrorTarjetaBloqueada}">
		            	<div class="error">
		            		<fmt:message key="flotaform.error.cargaarchivo.tarjetas.bloqueadas"/>
		            	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.tarjeta"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="tarjetaError" items="${listErrorTarjetaBloqueada}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"  ></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${tarjetaError.id}     
										</td>
						            	<td>
								       		${tarjetaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
    				<c:if test="${not empty listErrorTarjetaNoHabilitada}">
		            	<div class="error">
		            		<fmt:message key="flotaform.error.cargaarchivo.tarjetas.nohabilitada"/>
		            	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.tarjeta"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="tarjetaError" items="${listErrorTarjetaNoHabilitada}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"  ></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${tarjetaError.id}     
										</td>
						            	<td>
								       		${tarjetaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
    				<c:if test="${not empty listErrorTarjetaUsada}">
		            	<div class="error">
		            		<fmt:message key="flotaform.error.cargaarchivo.tarjetas.usada"/>
		            	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.tarjeta"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="tarjetaError" items="${listErrorTarjetaUsada}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"  ></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${tarjetaError.id}     
										</td>
						            	<td>
								       		${tarjetaError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>   				
    				
    				
		            <c:if test="${not empty listErrorAliasBlanca}">
		            	<div class="error">
		              		<fmt:message key="flotaform.error.cargaarchivo.alias.obligatorio"/>
		            	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.alias"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="aliasError" items="${listErrorAliasBlanca}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${aliasError.id}     
										</td>
						            	<td>
								       		${aliasError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>
    				
		            <c:if test="${not empty listErrorAliasNoCorresponde}">
		            	<div class="error">
		              		<fmt:message key="flotaform.error.cargaarchivo.alias.nocorresponde"/>
		            	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.alias"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="aliasError" items="${listErrorAliasNoCorresponde}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${aliasError.id}     
										</td>
						            	<td>
								       		${aliasError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>

		            <c:if test="${not empty listErrorObservacionBlanca}">
		            	<div class="error">
		              		<fmt:message key="flotaform.error.cargaarchivo.observaciones.obligatorio"/>
		             	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.observaciones"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="observacionesError" items="${listErrorObservacionBlanca}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"  ></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${observacionesError.id}     
										</td>
						            	<td>
								       		${observacionesError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>

		            <c:if test="${not empty listErrorObservacionesLongitud}">
		            	<div class="error">
		              		<fmt:message key="flotaform.error.cargaarchivo.observaciones.longitud"/>
		             	</div>  		            
		            	<div>
							<table cellpadding="0" class="table" cellspacing="0" style="width: 300px"> 
							<thead> 
								<tr> 
						            <th scope="col" width="30px"><fmt:message key="common.fila"/></th>		      
						            <th scope="col" width="*"><fmt:message key="common.observaciones"/></th>
								</tr>
							</thead>	
							<tbody>
								<c:forEach var="observacionesError" items="${listErrorObservacionesLongitud}" varStatus="status">			
									<c:choose>
										  <c:when test="${status.index % 2 == 0}"><tr class="odd"  ></c:when>
										  <c:otherwise><tr class="even" ></c:otherwise>
									</c:choose>	
						            	<td>
								       		${observacionesError.id}     
										</td>
						            	<td>
								       		${observacionesError.deDescripcion}     
										</td>											
						           	</tr>
						        </c:forEach>													
							</tbody>	
							</table>
						</div> 
    				</c:if>

</form:form>
<script>
function validacion(obj){
	return validateFileUpload(obj);
}


</script>
<v:javascript formName="fileUpload" staticJavascript="false"/>
<script type="text/javascript" src="<c:url value="/scripts/validator.jsp"/>"></script>